package com.dream.keigezhushou.Activity.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.dream.keigezhushou.Activity.acty.listen.golden.SearchYourselfActivity;
import com.dream.keigezhushou.R;

import java.util.ArrayList;

/**
 * Created by mxmf-001 on 17/3/11.
 */
public class SearchYourselfAdapter extends RecyclerView.Adapter<SearchYourselfAdapter.MyViewHolder> {

    private Context context;
    private ArrayList<String> yourlist;


    public SearchYourselfAdapter(Context context, ArrayList<String> yourlist) {
        this.context = context;
        this.yourlist = yourlist;

    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.search_yourself_item, null);
        return new MyViewHolder(view);
    }


    public void onBindViewHolder(MyViewHolder holder, int position) {


        holder.tvpackgeName.setText(""+yourlist.size());
        holder.checkBoxbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

            }
        });


    }

    @Override
    public int getItemCount() {
        return yourlist.size();
    }


    public class MyViewHolder extends RecyclerView.ViewHolder {
        TextView tvpackgeName;
        TextView tvMusicCount;
        ImageView ivPackge;
        CheckBox checkBoxbar;


        public MyViewHolder(View itemView) {

            super(itemView);
            tvpackgeName = (TextView) itemView.findViewById(R.id.tv_packge_name);
            tvMusicCount = (TextView) itemView.findViewById(R.id.tv_musicCount);
            ivPackge = (ImageView) itemView.findViewById(R.id.iv_packege);
            checkBoxbar = (CheckBox) itemView.findViewById(R.id.checkboxbar);
        }
    }
}
